package com.example.goodog.customViews;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;

import com.example.goodog.MyApplication;
import com.example.goodog.R;
import com.example.goodog.activities.DisplayMapActivity;
import com.example.goodog.interfaces.IShowOnMap;

public class ShowOnMapButton extends ListViewButton {

	Context context;
	public ShowOnMapButton(Context c,final IShowOnMap item) {
		super(c, R.drawable.map);
		context = c;
		
		this.setOnClickListener(new View.OnClickListener() {

			@Override
			public void onClick(View v) {      
				Intent intent = new Intent(context, DisplayMapActivity.class);
				intent.putExtra("SingleMarker",true);
				MyApplication.setSingleListItem(item);
				((Activity)(v.getContext())).startActivity(intent); 
			}
		});
	}
	

}
